package com.example.cinema;

import java.util.Date;
import java.util.UUID;

public class Ticket {
    private String id; // 唯一票号
    private Session session;
    private int row;
    private int seat;
    private double price;
    private Date saleTime;
    private boolean isRefunded;

    public Ticket(Session session, int row, int seat, double price) {
        this.id = UUID.randomUUID().toString().substring(0, 8); // 简化UUID
        this.session = session;
        this.row = row;
        this.seat = seat;
        this.price = price;
        this.saleTime = new Date();
        this.isRefunded = false;
    }

    // getter和setter
    public String getId() { return id; }
    public Session getSession() { return session; }
    public int getRow() { return row; }
    public int getSeat() { return seat; }
    public double getPrice() { return price; }
    public boolean isRefunded() { return isRefunded; }
    public void setRefunded(boolean refunded) { isRefunded = refunded; }
}